package org.example.what_mall.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Schema(description = "订单")
@TableName("orders")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Order {
    @Schema(description = "订单id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "卖方id")
    @TableField(value = "sellerId")
    private Integer sellerId;

    @Schema(description = "买方id")
    @TableField(value = "buyerId")
    private Integer buyerId;

    @Schema(description = "商品id")
    @TableField(value = "goodsDetailId")
    private Integer goodsDetailId;

    @Schema(description = "订单状态")
    @TableField(value = "state")
    private Integer state;

    @Schema(description = "购买量")
    @TableField(value = "num")
    private Integer num;

    @Schema(description = "金额")
    @TableField(value = "amount")
    private Integer amount;

    @Schema(description = "创建时间")
    @TableField(value = "createtime")
    private LocalDateTime createtime;

}
